<div class="grid_4">
	<div class="da-panel">
		<div class="da-panel-header">
			<span class="da-panel-title"> <img
				src="images/icons/color/accept.png" alt="" /> Edit category
			</span>
		</div>
		<div class="da-panel-content">
			<form id="da-ex-validate1-edit" class="da-form" action="" method="post"
				enctype="multipart/form-data">
				<?php if($this->Message!=''){?>
					<div class="da-message success">
	                     <?php echo $this->Message;?>
	                </div>
				<?php }?>
				<div id="da-ex-val1-error" class="da-message error"
					style="display: none;"></div>
				<div class="da-form-inline">
					<div class="da-form-row">
						<label>Name<span class="required">*</span></label>
						<div class="da-form-item large">
							<input type="text" name="name"
								value="<?php echo $this->Categories->name?>" />
						</div>
					</div>
					<div class="da-form-row">
						<label>Thumbnail <span class="required">*</span></label>
						<div class="da-form-item large" style="width: 100px;height: 80px; padding:10px;">
							<img src="<?php echo $this->Categories->getThumbnail();?>" width="100" height="80" alt="<?php echo $this->Categories->name;?>"/>
						</div>
						<div class="da-form-item large">
							
							<input type="file" name="image" class="da-custom-file" />

						</div>
						<label for="file1" class="error" generated="true"
							style="display: none;"></label>
					</div>
					<div class="da-form-row">
						<label>Parent</label>
						<div class="da-form-item large">
							<span class="formNote">This is a form note</span>
							<?php echo $this->formSelect('parents',$this->Categories->parents,array('class'=>'chzn-select','id'=>'parent_categories'),Categories::getOption(array('0'=>'===Select one===')));?>
						</div>
					</div>
					<div class="da-form-row">
						<label>Type</label>
						<div class="da-form-item large">
							<span class="formNote">This is a form note</span>
							<?php echo $this->formSelect('type',null,array('id'=>'type'),Categories::getOptionType())?>
						</div>
					</div>
					<div class="da-form-row">
						<label>Description<span class="required">*</span></label>
						<div class="da-form-item large">
							<input type="text" name="description"
								value="<?php echo $this->Categories->description;?>" />
						</div>
					</div>
					<div class="da-form-row">
						<label>Status</label>
						<div class="da-form-item small">
							<span class="formNote">Status of attribute</span>
							<?php echo $this->formSelect('status',$this->Categories->status,array(),array('1'=>'Enable','0'=>'Disable'))?>
						</div>
					</div>
				</div>
				<div class="da-button-row">
					<input type="submit" value="Save" class="da-button green" />
				</div>
			</form>
		</div>
	</div>
</div>
<script>
$(document).ready(function(){
	$("#da-ex-validate1-edit").validate(
		{
			ignore : ".ignore",
			rules : {
				name : {
					required : true
				},
				parents : {
					required : true
				},
				description : {
					required : true
				},
				status : {
					required : true
				}
			},
			invalidHandler : function(f, d) {
				var g = d.numberOfInvalids();
				if (g) {
					var e = g == 1 ? "You missed 1 field. It has been highlighted"
							: "You missed "
									+ g
									+ " fields. They have been highlighted";
					$("#da-ex-val1-error").html(e).show();
				} else {
					$("#da-ex-val1-error").hide();
				}
			}
		});
	
});
</script>